export default {
  name: 'loading',
  bind(el, binding) {
    el.style.position = 'relative';
    const loadingMask = document.createElement('div');
    loadingMask.className = 'mask';
    const loadingIcon = document.createElement('i');
    loadingIcon.className = 'Icon';
    loadingMask.appendChild(loadingIcon);
    if (binding.modifiers.fullscreen) {
      document.body.appendChild(loadingMask);
    } else {
      el.appendChild(loadingMask);
    }
    el.ele = loadingMask;
  },
  inserted(el, binding) {
  },
  update(el, binding) {
    if (binding.value) {
      el.ele.style.display = 'block';
    } else {
      el.ele.style.display = 'none';
    }
  },
};
